package cn.com.vs;

import java.sql.Connection;
import java.sql.SQLException;

import javax.sql.DataSource;

import com.mchange.v2.c3p0.ComboPooledDataSource;

public class DBManager {
	private ComboPooledDataSource cpds = null;
	private static DBManager instance = new DBManager();
	protected DBManager(){};
	public static DBManager getInstance(){
		return instance;
	}

	public boolean init( ComboPooledDataSource ds ){
		cpds = ds;
		return true;
	}
	
	public Connection getConnection() throws SQLException{
		return cpds.getConnection();
	}

	public DataSource getDatasource(){
		return cpds;
	}
}
